<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>With</title>
<script type="text/javascript">
	var obj = function() {
		this.a = 1;
		this.b = 2;
		this.c = 5;
		this.fun = function() {
			this.c = this.a + this.b;
		}
	};
	var o = new obj();
	o.fun();
	//alert(o.c);
</script>
<script type="text/javascript">
	var obj = {
		a: 1,
		b: 2,
		c: 5,
		fun: function() {
			this.c = this.a + this.b;
		}
	};
	var o = new obj();
	o.fun();
	//alert(o.c);
</script>
<script type="text/javascript">
	var obj = function() {
		this.a = 1;
		this.b = 2;
		this.c = 5;
	};
	obj.prototype.fun = function() {
		this.c = this.a + this.b;
	}
	var o = new obj();
	o.fun();
	//alert(o.c);
</script>
<script type="text/javascript">
	var funtemp = function() {
		c = a + b;
	}
	var obj = {
		a: 1,
		b: 2,
		c: 5
	};
	var fun;
	with(obj) {
		eval("fun = " + funtemp);
	}
	fun();
	alert(obj.c);
</script>
</head>
<body>

</body>
</html>